package methods

import "fmt"

//返回的类型 func() int
func initSeq() func() int {
	i := 0

	//定义并返回 func() int类型
	return func() int {
		i += 1
		return i
	}
}

func DeomClosures() {
	nextInt := initSeq()

	fmt.Println(nextInt())
	fmt.Println(nextInt())
	fmt.Println(nextInt())

	newInts := initSeq()
	fmt.Println(newInts())
	fmt.Println(newInts())
}
